CC=gcc
CFLAGS=-c -Wall -D_GNU_SOURCE -std=gnu99 
CFLAGS+=-DUSE_NETLINK
CFLAGS+=-DUSE_SCHED_RR
#CFLAGS+=DCOMPUTE_STDDEV
#CFLAGS+=-DRND_MIGRATION
LDFLAGS=-lm -lpthread -lrt
LDFLAGS+=-lnuma
SOURCES=config.c nl.c my_numa.c utils.c juggle.c
OBJECTS=$(SOURCES:.c=.o)
EXECUTABLE=juggle

all: $(SOURCES) $(EXECUTABLE) 

$(EXECUTABLE): $(OBJECTS) *.h
	$(CC) $(OBJECTS) $(LDFLAGS) -o $@
	etags *.c *.h

.c.o: *.h
	$(CC) $(CFLAGS) $< 

clean:
	rm -f $(OBJECTS) $(EXECUTABLE)

